/*########
# guild_guard
#########*/

#include "ScriptPCH.h"

class guild_guard : public CreatureScript
{
public:
    guild_guard() : CreatureScript("guild_guard") { }

    CreatureAI* GetAI(Creature* creature) const
    {
        return new guild_guardAI (creature);
    }

    struct guild_guardAI : public ScriptedAI
    {
        guild_guardAI(Creature* creature) : ScriptedAI(creature)
        {
            Reset();
        }

        void EnterCombat(Unit* pWho)
        {
                Player* p = pWho->ToPlayer();

                if(p)
                {
                        if (p->GetGuildId() == 2)
                        {
                                me->setFaction(35);
                        }else{
                                me->setFaction(103);                            
                        }
                }
        }
    };
};

void AddSC_guild_guard()
{
    new guild_guard();
}
